<div class='span12'>
	<!-- HEADER -->
	<div class='row-fluid'>
		<div class='span12'>
			<div class='page-header'>

				<h1 class="span8">
					<i class='icon-bullhorn'></i> <span>USER PROFILE</span>
				</h1>
			</div>
		</div>
	</div>

	<div class="row-fluid">

		<div class="span12 box">
			<div class="box-content box-double-padding">
				<p>
					<small class="text text-error pull-right">Fields denoted with an
						asterisk (*) are mandatory</small>
				</p>
				<hr class="normal">
				<?php if(Session::get('message')){?>
				<p>
					<span class="text-danger">
						<div class="alert alert-info">
							<?php echo Session::get('message');?>
						</div>
					</span>
				</p>
				<?php }?>
				<form class="form" action="<?= URL::current();?>" method="post"
					style="margin-bottom: 0;">
					<fieldset>
						<div class="span4">
							<div class="lead">
								<i class="icon-signin text-contrast"></i> Login info
							</div>
							<small class="muted">Lorem ipsum dolor sit amet, consectetur
								adipiscing elit. Donec nisl est, vulputate at porttitor non,
								interdum a mauris. Phasellus imperdiet gravida pulvinar.</small>
						</div>
						<div class="span5 offset1">
						<div class="control-group">
								<label class="control-label">User Name <span
									class="text text-error">*</span>
								</label>
								<div class="controls">
									<span class="text text-error"><?php echo $errors->first('email') ?>
									</span> <input class="span12" name="username" id="username"
										placeholder="E-mail" type="text"
										value="<?= $profile->username;?>">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">E-mail <span
									class="text text-error">*</span>
								</label>
								<div class="controls">
									<span class="text text-error"><?php echo $errors->first('email') ?>
									</span> <input class="span12" name="email" id="email"
										placeholder="E-mail" type="text"
										value="<?= $profile->email;?>">
								</div>
							</div>
							<hr class="hr-normal">
							<?php if($errors->first('password') == $errors->first('confirmpassword')){?>
							<div class="control-group">
								<div class="controls">
									<label class="checkbox"> <input data-target="#change-password"
										data-toggle="collapse" id="changepasswordcheck"
										value="option1" type="checkbox"> Change password?
									</label>
								</div>
							</div>
							
							<div class="collapse" id="change-password">
								<div class="control-group">
									<label class="control-label">Password <span
										class="text text-error">*</span>
									</label>
									<div class="controls">
										<span class="text text-error"><?php echo $errors->first('password') ?>
										</span> <input class="span12" name="password" id="password"
											placeholder="Password" type="password"
											>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">Password confirmation <span
										class="text text-error">*</span>
									</label>
									<div class="controls">
										<span class="text text-error"><?php echo $errors->first('confirmpassword') ?>
										</span> <input class="span12" name="confirmpassword"
											id="confirmpassword" placeholder="Password confirmation"
											type="password" >
									</div>
								</div>
							</div>
							<?php }?>
							<?php if($errors->first('password') != $errors->first('confirmpassword')){?>
							<div class="control-group">
								<label class="control-label">Password <span
									class="text text-error">*</span>
								</label>
								<div class="controls">
									<span class="text text-error"><?php echo $errors->first('password') ?>
									</span> <input class="span12" name="password" id="password"
										placeholder="Password" type="password"
										>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">Password confirmation <span
									class="text text-error">*</span>
								</label>
								<div class="controls">
									<span class="text text-error"><?php echo $errors->first('confirmpassword') ?>
									</span> <input class="span12" name="confirmpassword"
										id="confirmpassword" placeholder="Password confirmation"
										type="password" >
								</div>
							</div>
							<?php }?>
						</div>
					</fieldset>
					<hr class="hr-normal">
					<fieldset>
						<div class="span4 box">
							<div class="lead">
								<i class="icon-user text-contrast"></i> Personal info
							</div>
							<small class="muted">Proin eu nibh ut urna tristique rhoncus. Sed
								euismod, quam sed dignissim imperdiet, nulla leo vehicula mi, a
								sagittis lacus augue nec sapien.</small>
						</div>
						<div class="span5 offset1">
							<div class="control-group">
								<label class="control-label">Full Name <span
									class="text text-error">*</span>
								</label>
								<div class="controls">
									<span class="text text-error"><?php echo $errors->first('name') ?>
									</span> <input class="span12" name="name" id="name"
										placeholder="First name" type="text"
										value="<?= $profile->name;?>">
								</div>
							</div>
							<hr>
							<div class="control-group">
								<label class="control-label">Role </label>
								<div class="controls">

									<input type="text" class="span12"
										value="<?= Users::find($profile->id)->role()->first()->name ;?>"
										readonly>
								</div>
							</div>
						</div>
					</fieldset>
					<div class="form-actions" style="margin-bottom: 0;">
						<div class="text-right">
							<input type="hidden" name="userID" id="userID"
								value="<?= $profile->id;?>">
							<button class="btn btn-primary" type="submit">
								<i class="icon-save"></i> Save
							</button>
						</div>

					</div>
				</form>
			</div>
		</div>
	</div>
</div>





